<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>React</title>
    <script src="../build/react.js"></script>
    <script src="../build/react-dom.js"></script>
    <script src="../build/browser.min.js"></script>
  </head>
  <body>
    <div id="example"></div>
    <script type="text/babel">
      let LikeButton=React.createClass({
        getInitialState: function(){
          return {liked:false};
        },
        handleClick:function(event){
          this.setState({liked:!this.state.liked});
        },
        render:function(){
          let text=this.state.liked ? 'like' : 'don\'t like';

          return (
            <p onClick={this.handleClick}>
              you <button>{text}</button> this. Click to toggel.
            </p>
          )
        }
      });

      ReactDOM.render(
        <LikeButton></LikeButton>,
        document.getElementById('example')
      );

    </script>
  </body>
</html>
